package io.printff;

import java.io.FileNotFoundException;
import java.io.PrintStream;

public class Text2 {
    public static void main(String[] args) {
        //这里的out指向空默认也就是控制面板
        System.out.println("12123");
        //创立自己的打印流
        try(PrintStream A=new  PrintStream ("D:\\workspace\\basic-chapter\\src\\io\\printff\\A.txt");) {
            //打印流改为A
            System.setOut(A);
            System.out.println("老骥伏枥");
            System.out.println("志在千里");

        } catch (Exception e) {
            throw new RuntimeException(e);
        }
    }
}
